import java.util.Random;

/**
 * If there are no bugs, it was created by Chen FengYao on 2018/4/2;
 * Otherwise, I don't know who created it either
 */

public class Test04 {
    public static void main(String[] args) {
        // 定义1个10个元素的数组
        // 生成10个随机数,放入这个数组中
        // 最后再输出这个数组 看一下
        int[] a = new int[10];
        Random random = new Random();

        for (int i = 0; i < a.length; i++) {
            a[i] = random.nextInt(20);
        }

        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }

        // 求 这个数组中 的最大值
        int max = 0;
        for (int i = 0; i < a.length; i++) {
            if (max < a[i]) {
                max = a[i];
            }
        }
        System.out.println(max);
        // 求最小值 min

        int min = 20;
        for (int i = 0; i < a.length; i++) {
            if (min > a[i]) {
                min = a[i];
            }
        }
        System.out.println(min);
    }
}
